module.exports = {
    entry: {
        index: './websrc/main/index.js'
        //, 'some-other-page': ['./websrc/main/some/other/page.js']
    },
    output: {
        path: __dirname + '/src/main/webapp/assets/js',
        filename: '[name].js'
    },

    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: [{
                    loader: 'babel-loader',
                    query: {
                        presets: ['es2015', 'stage-0', 'react'],
                        // Ant Design 设置按需加载
                        'plugins': [
                            ['import', {'libraryName': 'antd', 'style': 'css'}]// `style: true` 会加载 less 文件
                        ]
                    }
                }]
            }, {
                test: /\.css$/,
                use: [{
                    loader: 'style-loader'
                }, {
                    loader: 'css-loader',
                    // 为了 Ant-Design 得把下面注释掉
                    /*
                    options: {
                        module: true,
                        localIdentName: '[path][name]__[local]--[hash:base64:5]'
                    }
                    */
                }]
            }, {
                test: /\.less$/,
                use: [{
                    loader: 'style-loader' // creates style nodes from JS strings
                }, {
                    loader: 'css-loader', // translates CSS into CommonJS
                    // 为了 Ant-Design 得把下面注释掉
                    /*
                    options: {
                        module: true,
                        localIdentName: '[path][name]__[local]--[hash:base64:5]'
                    }
                    */
                }, {
                    loader: 'less-loader' // compiles Less to CSS
                }]
            }]
    }
};
			
			